<template>
	<view class="all">
		<my-tab color='#333333'></my-tab>
		<view class="wrap" >
			<view>
			</view>
			<swiper @change="swiperChange" class="swiper" :duration="500" :current='current' autoplay circular>
				<swiper-item v-for="(item,index) in list">
					<image :src="item.image" style="width: 100%;height: 100%" />
				</swiper-item>
			</swiper>
			<view class="wrap_2">
				<text>{{current+1}}</text>
				<text>/</text>
				<text>{{list.length}}</text>
			</view>
		</view>
		<view class="" v-if="!type">
			<view class="ks">
				<view style="display: flex;align-items: center;">
					<view class="ks1">颜色/款式</view>
					<view class="ks2">
						<view class="ks2_1" v-for="(item,index) in 3">
							<image src='https://s4.ax1x.com/2022/01/26/7qgtiT.png' />
						</view>
					</view>
				</view>
				<view class="ks3">
					<image src="https://s4.ax1x.com/2022/01/26/7qggJO.png" />
				</view>
			</view>
			<view class="xian" />
			<view class="jiage">
				<view class="jiage_1">
					<text>￥50.00</text>
					<text>￥50.00</text>
				</view>
				<view class="jiage_2">
					1225人兑换
				</view>
			</view>
			<view class="jiage_3">
				影响幼教的力量图书一场影响幼教的力量图书一 场影响幼教的力量图...
			</view>
			<view class="konge" />
			<view class="dizhi">
				<view class="dizhi_1">
					<text>送至</text>
					<view class="dizhi_2">
						<view class="dizhi_3">
							<view class="dizhi_3_1">
								<image src="https://s4.ax1x.com/2022/01/26/7qfRAI.png" />
								<text>河南省郑州市</text>
							</view>
							<view class="dizhi_3_2">
								龙柏路论观海路金成中心四单元户
							</view>
							<view class="xian" />
						</view>
						<image src="https://s4.ax1x.com/2022/01/26/7qggJO.png" style="
							width: 14rpx;
							height: 38rpx;
							float: right;" />
					</view>
				</view>
			</view>
			<view class="yun">
				<text>运费</text>
				<text>包邮</text>
			</view>
			<view class="konge" />
			<view class="xiang">
				<view class="xiang1">
					<my-text :text="'详情'" width='65rpx'></my-text>
				</view>
				<view class="img" :style="{
			'background-image':$img('https://s4.ax1x.com/2022/01/26/7qxOOA.png')
					}">

				</view>
			</view>
			<view class="cai">
				<my-text text="猜你喜欢"></my-text>
				<view class="cait">
					<s-list></s-list>
				<!-- 	<view class="cai_2" v-for="(item,index) in 2">
						<view class="cai_2_1">
							<image src="https://s4.ax1x.com/2022/01/26/7LpWLj.png"
								style="width: 335rpx;height: 335rpx;" />
						</view>
						<view style="padding: 0rpx 15rpx 15rpx;">
							<view class="cai_2_2">教师如何观察评价幼儿</view>
							<view class="cai_2_3">
								<text>￥50.00</text>
								<text>￥120.00</text>
							</view>
						</view>

					</view> -->
				</view>
			</view>
			<!-- height:showb==true?true:false,
			height1:showb==false?true:false, -->
			<view :class="{
					foot:true,
				
				}">
				<view class="footoie">
					<view class="foot_1">
						<image src="https://s4.ax1x.com/2022/01/26/7L9bNt.png" />
						<text>收藏</text>
					</view>

					<view class="foot_1">
						<image src="https://s4.ax1x.com/2022/01/26/7LCKER.png" />
						<text>分享</text>
					</view>

				</view>
				<image @click="play" src="https://s4.ax1x.com/2022/01/26/7LCtDH.png"
					style="width: 300rpx;height: 88rpx;" />
			</view>
		</view>
		<u-popup v-model="show" mode="bottom" border-radius='30' :mask-close-able='false'>
			<view class="popup">
				<view style="text-align: center;">
					<view class="popup_1">
						<text style="font-size: 35rpx;">￥</text>
						<text>{{(num*50).toFixed(2)}}</text>
					</view>
					<view class="popup_2">￥1000.00</view>
				</view>
				<view class="popup2">
					<view class="popup2_1">颜色/款式分类</view>
					<view class="popup2_2">
						<view class="popup2_2_1" v-for="(item,index) in 3">
							<image src="https://s4.ax1x.com/2022/01/26/7LnlcR.png"
								style="width: 61rpx ;height: 61rpx;" />
							<text>白色</text>
						</view>
					</view>
					<view class="xian">
					</view>
					<view class="popup3">
						<text>购买数量</text>
						<view class="popup3_1">
							<text @click="jian">-</text>
							<text>{{num}}</text>
							<text @click="jia">+</text>
						</view>
					</view>
					<!-- //购买 -->
					<view class="foot_1">
						<image @click="play_" src="https://s4.ax1x.com/2022/01/26/7LKLc9.png" />
					</view>
					<!-- 取消 -->
					<view class="foot_2" @click="(show=false,type=false)">
						<image src="https://s4.ax1x.com/2022/01/26/7LMmAf.png" />
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: false,
				current: 0,
				num: 1,
				show: false,
				clientY: '',
				showb: true,
				height:'',
				list: [{
						image: 'https://s4.ax1x.com/2022/01/26/7qwVaQ.png',
						title: '昨夜星辰昨夜风，画楼西畔桂堂东'
					},
					{
						image: 'https://s4.ax1x.com/2022/01/26/7qwVaQ.png',
						title: '身无彩凤双飞翼，心有灵犀一点通'
					},
					{
						image: 'https://s4.ax1x.com/2022/01/26/7qwVaQ.png',
						title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
					}
				],
			};
		},
		mounted() {
			this.height=this.getPhoneInfo.statusBarHeight
			console.log()
		},
		onPageScroll(res) {
			let h = res.scrollTop;
			if (h > this.clientY) {
				this.clientY = res.scrollTop;
				this.showb = true
			} else if(this.clientY-h>100) {
				this.clientY = res.scrollTop;
				this.showb = false
			}
		},
		methods: {
			play_() {
				uni.navigateTo({
					url: './shoppdingdan'
					// url: `/pages/play/play?type=${'商城'}&money=${50*this.num}`
				})
			},
			jia() {
				this.num++
			},
			jian() {
				if (this.num <= 1) {
					this.$toast('数量不能小于1', 0)
					return
				}
				this.num--
			},
			play() {
				this.type = true,
					this.show = true
				// uni.navigateTo({
				// 	url: '../shoppxuanze'
				// })
			},
			gow() {
				console.log("66966")
				uni.navigateBack({
					delta: 1
				})
			},
			//轮播图的切换事件  
			swiperChange(e) {
				this.current = e.target.current //获取当前轮播图片的下标, 可以给当前指示点加样式
			}
		}
	}
</script>

<style lang="scss">
	.popup {
		position: relative;
		padding-top: 70rpx;
		height: 834rpx;
		background-color: white;

		.foot_2 {
			text-align: center;
			position: absolute;
			right: 20rpx;
			top: 70rpx;

			image {
				width: 54rpx;
				height: 54rpx;
				text-align: center;
			}
		}

		.foot_1 {
			text-align: center;
			position: absolute;
			bottom: 40rpx;
			width: 100%;
			width: 100%;

			image {
				width: 300rpx;
				height: 88rpx;
				text-align: center;
			}
		}

		.popup3 {
			margin-top: 40rpx;

			.popup3_1 {
				text:nth-of-type(1) {
					width: 50rpx;
					height: 50rpx;
					border-radius: 100%;
					display: inline-block;
					text-align: center;
					line-height: 50rpx;
					background-color: rgb(245, 245, 245);
				}

				text:nth-of-type(2) {
					font-size: 28rpx;
					font-family: HarmonyOS Sans;
					font-weight: 400;
					line-height: 0px;
					color: #131314;
					opacity: 1;
					margin: 0 20rpx 0 20rpx;

				}

				text:nth-of-type(3) {
					width: 50rpx;
					height: 50rpx;
					border-radius: 100%;
					display: inline-block;
					text-align: center;
					line-height: 50rpx;
					background-color: rgb(245, 245, 245);
				}
			}

			display: flex;
			justify-content: space-between;

			text:nth-of-type(1) {
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #131314;
				opacity: 1;
			}
		}

		.popup2 {
			.xian {
				height: 1rpx;
				background-color: #E3E3E3;
				margin-top: 20rpx;
			}

			padding: 30rpx;
			margin-top: 30rpx;

			.popup2_1 {
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #131314;
				opacity: 1;
			}

			.popup2_2 {
				display: flex;
				flex-wrap: wrap;
				margin-top: 35rpx;

				.popup2_2_1 {
					margin-right: 15rpx;

					text {
						font-size: 28rpx;
						font-family: Source Han Sans CN;
						font-weight: 500;
						color: #131314;
						opacity: 1;
						margin-left: 10rpx;
					}

					width: 170rpx;
					height: 75rpx;
					border-radius: 50rpx;
					background-color:rgba(245, 245, 245, 0.6);
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}

		.popup_2 {
			text-decoration: line-through;
			font-size: 24rpx;
			font-family: HarmonyOS Sans;
			font-weight: 400;
			color: #91969A;
			opacity: 1;
		}

		.popup_1 {
			text {
				font-size: 50rpx;
				font-family: HarmonyOS Sans;
				font-weight: 500;
				color: #FF2424;
				opacity: 1;
			}
		}
	}

	@keyframes example {
		from {
			height: 0px;
		}

		to {
			height: 120rpx;
		}
	}

	@keyframes example1 {
		from {
			height: 120rpx;
		}

		to {
			height: 0rpx;
		}
	}

	.height {
		animation-name: example;
		height: 120rpx;
		overflow: hidden;
		animation-duration: 1s;
	}

	.height1 {
		height: 0px;
		animation-duration: 1s;
		animation-name: example1;
		overflow: hidden;
	}

	.foot {
		position: fixed;
		bottom: 0;
		width: 100%;
		height: 120rpx;
		

		.footoie {
			display: flex;
			align-items: center;
			width: 40%;
			justify-content: space-around;
		}

		display: flex;
		justify-content: space-around;
		align-items: center;
		background-color: #131314;

		.foot_1 {
			text-align: center;

			text {
				margin-top: -8rpx;
				display: block;
				font-size: 28rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #FFFFFF;
			}

			image {
				width: 44rpx;
				height: 44rpx;
			}

		}
	}

	.cai {
		background-color: #F8F8FA;
		padding: 30rpx;

		.cait {
			margin-top: 20rpx;
			display: flex;
			justify-content: space-between;
			margin-bottom: 120rpx;
		}

		.cai_2 {
			width: 49%;
			background-color: white;

			.cai_2_3 {
				text:nth-of-type(1) {
					font-size: 34rpx;
					font-family: HarmonyOS Sans;
					font-weight: bold;
					color: #FF2424;
					opacity: 1;
				}

				text:nth-of-type(2) {
					margin-left: 20rpx;
					font-size: 20rpx;
					font-family: HarmonyOS Sans;
					font-weight: 400;
					color: #91969A;
					opacity: 1;

				}
			}

			.cai_2_2 {
				font-size: 30rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #333333;
				opacity: 1;
			}

			.cai_2_1 {
				background-color: white;
				width: 100%;
			}
		}
	}

	.xiang {
		.xiang1 {
			padding: 30rpx;
		}

		.img {
			background-size: 100% 100%;
			background-repeat: no-repeat;
			min-height: 4496rpx;

		}
	}

	.yun {
		padding: 20rpx 30rpx 20rpx 30rpx;
		display: flex;
		justify-content: space-between;

		text:nth-of-type(1) {
			font-size: 28rpx;
			font-family: Source Han Sans CN;
			font-weight: bold;
			color: #131314;
			opacity: 1;
		}

		text:nth-of-type(2) {
			display: inline-block;
			width: 90%;
			padding-left: 20rpx;
			font-size: 28rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #131314;
			opacity: 1;
		}
	}

	.dizhi {
		padding: 20rpx 30rpx 0 30rpx;

		.dizhi_1 {
			display: flex;
			justify-content: space-between;

			text:nth-of-type(1) {
				font-size: 28rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #131314;
				opacity: 1;
			}

			.dizhi_2 {
				display: flex;
				width: 90%;
				padding-left: 20rpx;
				justify-content: space-between;

				.dizhi_3 {
					width: 98%;

					.xian {
						margin-top: 20rpx;
						border-bottom: 1rpx solid #E3E3E3;
					}

					.dizhi_3_2 {
						font-size: 24rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #91969A;
						margin-top: 5rpx;
						opacity: 1;
					}

					.dizhi_3_1 {
						display: flex;
						align-items: center;

						text {
							font-size: 28rpx;
							font-family: Source Han Sans CN;
							margin-left: 10rpx;
							font-weight: 400;
							color: #131314;
							opacity: 1;
						}

						image {
							width: 24rpx;
							height: 24rpx;
						}
					}
				}
			}
		}
	}

	.konge {
		height: 25rpx;
		background-color: #F8F8FA;
	}

	.jiage_3 {
		padding: 0rpx 30rpx 30rpx 30rpx;
		font-size: 32rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #131314;
		opacity: 1;
	}

	.jiage {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 30rpx;

		.jiage_2 {
			font-size: 22rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #91969A;
			opacity: 1;
		}

		.jiage_1 {
			text:nth-of-type(1) {
				font-size: 50rpx;
				font-family: HarmonyOS Sans;
				font-weight: 500;
				color: #FF2424;
				opacity: 1;
			}

			text:nth-of-type(2) {
				margin-left: 10rpx;
				font-size: 24rpx;
				font-family: HarmonyOS Sans;
				font-weight: 400;
				text-decoration: line-through;
				color: #91969A;
				opacity: 1;

			}
		}
	}

	.xian {
		height: 1rpx;
		background-color: #E3E3E3;
	}

	.ks {
		justify-content: space-between;
		padding: 30rpx;
		display: flex;
		align-items: center;

		.ks3 {
			image {
				width: 14rpx;
				height: 38rpx;

			}
		}

		.ks2 {
			margin-left: 20rpx;
			display: flex;

			.ks2_1 {
				margin-left: 15rpx;
				width: 75rpx;
				height: 75rpx;
				border-radius: 100%;
				display: flex;
				justify-content: center;
				background-color: #F1F1F1;
				align-items: center;

				image {
					width: 46rpx;
					height: 46rpx;
				}
			}
		}

		.ks1 {
			font-size: 22rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #131314;
			opacity: 1;
		}
	}

	.wrap {
		position: relative;
		height: 790rpx;

		.wrap23 {
			margin-left: 20rpx;
			position: absolute;
			z-index: 9999
		}

		.wrap_2 {
			position: absolute;
			bottom: 20rpx;
			right: 20rpx;
			background-color: rgba(19, 19, 20, 0.2);
			color: white;
			padding: 5rpx 25rpx 5rpx 25rpx;
			border-radius: 50rpx;

			text:nth-of-type(3) {
				font-size: 20rpx;
				font-family: HarmonyOS Sans;
				font-weight: 500;
				line-height: 0px;
				color: #FFFFFF;
				opacity: 1;
			}

			text:nth-of-type(1) {
				font-size: 28rpx;
				font-family: HarmonyOS Sans;
				font-weight: 500;
				line-height: 0px;
				color: #FFFFFF;
				opacity: 1;
			}
		}

		.swiper {
			height: 100%
		}

	}
</style>
